package com.anlogic.sdk.ui.tests.uc2.projectcreate.bspapp;



import java.util.regex.Pattern;


import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
import org.eclipse.swtbot.eclipse.finder.waits.Conditions;
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
import org.eclipse.swtbot.swt.finder.SWTBot;
import org.eclipse.swtbot.swt.finder.utils.SWTBotPreferences;
import org.eclipse.swtbot.swt.finder.waits.DefaultCondition;
import org.eclipse.swtbot.swt.finder.waits.ICondition;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;

import com.anlogic.sdk.ui.tests.utils.BspAppTestUtils;
import com.anlogic.sdk.ui.tests.utils.WorkspaceUtils;

public class CreateHELLOWORLDTest {
	private static SWTWorkbenchBot bot;
	
	@BeforeClass
	public static void setUpBeforeClass() throws Exception {
		bot = new SWTWorkbenchBot();
		//cleanWorkspace();
		bot.sleep(2000);
		SWTBotPreferences.TIMEOUT = 10000;
		SWTBotPreferences.PLAYBACK_DELAY = 500;
	}

	

	@Before
	public void setUp() throws Exception {
		WorkspaceUtils.resetworkbench(bot);
	}

	@After
	public void tearDown() throws Exception {
		WorkspaceUtils.cleanWorkspace();
	}
	
	@Test
	public void standaloneDr1m90core064Test() throws Exception{
		
		BspAppTestUtils.standaloneDr1m90core064Test(bot, "HELLOWORLD");
	}

	@Test
	public void standaloneDr1m90core164Test() throws Exception{

		BspAppTestUtils.standaloneDr1m90core164Test(bot, "HELLOWORLD");
		
	}
	@Test
	public void standaloneDr1m90core032Test() throws Exception{
		BspAppTestUtils.standaloneDr1m90core032Test(bot, "HELLOWORLD");
	}
	@Test
	public void standaloneDr1m90core132Test() throws Exception{
		BspAppTestUtils.standaloneDr1m90core132Test(bot, "HELLOWORLD");
	}
	
	@Test
	public void standaloneDr1v90core064Test() throws Exception{
		BspAppTestUtils.standaloneDr1v90core064Test(bot, "HELLOWORLD");

		
	}
	@Test
	public void standalonePh1p35core032Test() throws Exception{
		BspAppTestUtils.standalonePh1p35core032Test(bot, "HELLOWORLD");

		
	}
	
	
	@AfterClass
	public static void tearDownAfterClass() throws Exception {
	}
	public static void cleanWorkspace() throws CoreException {
	    IWorkspace workspace = ResourcesPlugin.getWorkspace();
	    for (IProject project : workspace.getRoot().getProjects()) {
	        project.delete(true, true, null);
	    }
	}
	

}
